export const changeFilesData = (val: any, formData: any, prop: string) => {
  const data = unref(formData);
  console.log(val, "val-val");
  if (!val?.length) {
    data[prop] = "";
    return;
  }

  const list = val.map((item: any) => item.url);
  const files = list.join(",");
  data[prop] = files;
};

export const changeOneImg = (val: any, formData: any, prop: string) => {
  const data = unref(formData);
  if (!val?.length) {
    data[prop] = "";
    return;
  }
  data[prop] = val[0].url;
};
